package com.test.singleton;

//静态内部类
public class Singleton1 {
    private Singleton1(){}

    private static Singleton1 instance;

    //静态内部类, 包含一个静态属性 Singleton1
    private static class SingletonInstance{
        private static final Singleton1 INSTANCE = new Singleton1();
    }

    public static Singleton1 getInstance(){
        return SingletonInstance.INSTANCE;
    }
}
